package cn.powertime.evaluation.service.impl;

import cn.powertime.evaluation.entity.CpsAutomatic;
import cn.powertime.evaluation.mapper.CpsAutomaticMapper;
import cn.powertime.evaluation.service.CpsAutomaticService;
import cn.powertime.evaluation.vo.RespAnswerTestPaperVo;
import cn.powertime.evaluation.vo.RespAnswerTopicListVo;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 用户智能练习表 服务实现类
 * </p>
 *
 * @author liqi
 * @since 2019-09-23
 */
@Service
public class CpsAutomaticServiceImpl extends ServiceImpl<CpsAutomaticMapper, CpsAutomatic> implements CpsAutomaticService {

    @Autowired
    private CpsAutomaticMapper automaticMapper;

    @Override
    public IPage<CpsAutomatic> selectPage(Page<CpsAutomatic> page, QueryWrapper<CpsAutomatic> qw) {
        return this.automaticMapper.selectPage(page, qw);
    }

    @Override
    public Page<RespAnswerTestPaperVo> selectAnswerRecord(Page page, Long userId) {
        return this.automaticMapper.selectAnswerRecordPage(page, userId);
    }

    @Override
    public List<RespAnswerTopicListVo> testPaperView(Long userId, Long testPaperId) {
        return this.automaticMapper.selectTestPaperView(userId, testPaperId);
    }

}
